//
// Created by HeiBai on 2020/6/13.
//

#ifndef NDK_PLAYER_CODE_VIDEOCHANNEL_H
#define NDK_PLAYER_CODE_VIDEOCHANNEL_H

#include "BaseChannel.h"

typedef void (*RenderCallback)(uint8_t *, int, int, int);

class VideoChannel : public BaseChannel {

public:
    VideoChannel(int streamIndex,
                 AVCodecContext *avCodecContext);

    virtual ~VideoChannel();

    void start();

    void stop();


    void video_decode();

    void video_player();

    void setRenderCallback(RenderCallback renderCallback);

private:
    pthread_t pid_video_decode;
    pthread_t pid_video_player;

    RenderCallback renderCallback;
};

#endif
